#ifndef _GEOMETRY_H
#define _GEOMETRY_H

#include "vector.h"

// ================== TRIANGLE ================== //
class Triangle{
	protected:
		Vector p[3];

	public:
		Triangle() {}
		Triangle(const Vector&,const Vector&,const Vector&);
		Triangle Shrink(const double&,const double&,const double&);
		
		double Area() const { return Norm((p[1] - p[0]) / (p[2] - p[0])) / 2.0; }
		inline Vector operator[](int i) const { return p[i]; }
};

// ================= QUADRANGLE ================= //
class Quadrangle
{
	protected:
		Vector p[4];

	public:
		Quadrangle() {}
		Quadrangle(const Vector&,const Vector&,const Vector&,const Vector&);
		Quadrangle Shrink(const double&,const double&,const double&,const double&);
		
		double Area() const { return Norm((p[1] - p[0]) / (p[2] - p[0])) +
									 Norm((p[2] - p[0]) / (p[3] - p[0])); }
		inline Vector operator[](int i) const { return p[i]; }
};

#endif // _GEOMETRY_H